<?php

namespace App\Kuafu\Customer\Model;

use App\Kuafu\Base\Model\Traits\KfSoftDeletes;
use Illuminate\Database\Eloquent\Builder;
use App\Kuafu\Base\Model\BaseModel;

class CustomerActionLogModel extends BaseModel
{
    use KfSoftDeletes;

    protected $connection = 'mysql';
    protected $table      = 'customer_action_log'; //表名
    protected $primaryKey = 'id';

    protected $fillable = [
        'userId',
        'openId',
        'unionid',
        'type',
        'userInfo',
        'createdAt',
        'updatedAt',
        'createdByUid',
        'updatedByUid',
        'isDeleted'
    ];

    public const ACTION_TYPE_APPLET_REGISTER              = 0; // 小程序用户注册
    public const ACTION_TYPE_APPLET_LEAVE_MOBILE          = 1; // 小程序用户留下手机号
    public const ACTION_TYPE_OFFICIAL_FOLLOW              = 20; // 公众号用户关注
    public const ACTION_TYPE_OFFICIAL_UNFOLLOW            = 40; // 公众号用户取消关注
    public const ACTION_TYPE_GET_ACTIVITY_COUPON          = 60; // 用户领券
    public const ACTION_TYPE_USE_ACTIVITY_COUPON          = 80; // POS核销
    public const ACTION_TYPE_MERCHANT_USE_ACTIVITY_COUPON = 81; // 商家端核销
    public const ACTION_TYPE_APPLET_LEAVE_INFORMATION     = 100; // 加盟小程序留资
    public const ACTION_TYPE_WECHAT_SERVICE_REGISTER      = 101; // 微信服务号用户注册

}
